<?php

header ( 'Content-type:text/html;charset=utf-8' );

ob_start();
session_start();

// date_default_timezone_set('UTC');
date_default_timezone_set ( 'Asia/Shanghai' );

define("HOMESITE", 'index');

error_reporting(E_ERROR | E_WARNING | E_PARSE);
define ( 'DEBUG', true );
// DEBUG ? error_reporting ( 7 ) : error_reporting ( 0 );

define ( 'F_ROOT', str_replace ( '\\', '/', dirname ( __FILE__ ) ) . '/'  );
define ( 'F_CONF', F_ROOT . 'config/' );
define ( 'F_INC', F_ROOT . 'include/' );
define ( 'F_LIB', F_ROOT . 'lib/' );
define ( 'F_CACHE', F_ROOT . 'cache/');
define ( 'F_OP', F_ROOT . 'op/' );
define ( 'F_SOURCE', F_ROOT . 'source/' );
define ( 'F_FCK', F_ROOT . 'fckeditor/' );

define('DEFAULT_DO', 'login.show');
define(TabName, 'tbl_');
define(PageNum, 10);
define ( 'F_UPLOAD', F_ROOT . 'upload_file/' );

include_once F_CONF . 'env.config.php';
include_once F_CONF . 'db.'.Env_Config.'.config.php';
include_once F_CONF . 'alert.config.php';
// include dirname(__FILE__).'/include/smarty.init.php';
// include dirname(__FILE__).'/include/db.init.php';

include dirname(__FILE__).'/include/memcache.init.php';

include_once F_INC.'common.php';
include_once F_INC.'db.class.php';
include_once F_INC.'show.class.php';
include_once F_INC.'template.class.php';
include_once F_INC.'view.class.php';

include_once F_OP . 'db.function.php';
include_once F_OP . 'base.function.php';

include_once F_SOURCE . 'base/model.base.php';
include_once F_SOURCE . 'base/ctrl.base.php';

include_once F_FCK . 'fckeditor.php';

if(ckLogin()==false)exit('请先登录！');

//op log start
$SpecialModel = array('launch', 'pic');
$SpecialAction = array('getKeywordsAds', 'getVBCAds', 'getKWHTML', 'getPicAds', 'getPicAdsHTML');
if (isset($_GET['do'])) {
	$do = explode('.', $_GET['do']);
} else {
	$do = explode('.', DEFAULT_DO);
}
if (!in_array($do[0], $SpecialModel) && !in_array($do[1], $SpecialAction)){
	include F_SOURCE.'op/op.ctrl.class.php';
	$opCtrl = new opCtrl();
	$opCtrl->add();
}
//op log end

$show = new Show();
$show->execute();

